package com.cos.openapi.web.controller;

import com.cos.openapi.common.ResponseResult;
import com.cos.openapi.common.ResultTable;
import com.cos.openapi.entity.Customer;
import com.cos.openapi.services.CustomerServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: COS
 * @time: 2021/11/25 16:10
 * @description:
 */
@RestController
@RequestMapping("/customer")
public class CustomerController {
    @Autowired
    private CustomerServices customerServices;
    @RequestMapping("/table")
    public ResultTable getTable(Integer page,Integer limit,String name,Integer state){
        return customerServices.table(page,limit,name,state);
    }
    @RequestMapping("/del")
    public ResponseResult del(Integer[] ids){
        return customerServices.del(ids);
    }
    @RequestMapping("/add")
    public ResponseResult add(Customer c){
        return customerServices.add(c);
    }
    @RequestMapping("/update")
    public ResponseResult update(Customer c){
        return customerServices.update(c);
    }


}
